<?php
declare (strict_types = 1);

namespace app\adminapi\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class pyg_goods extends Model
{
    //
    protected $table = 'pyg_goods';
    public function cate(){
        return $this->hasOne(pyg_category::class,'id','cate_id')->bind(['cate_name']);
    }

    public function brands(){
        return $this->belongsTo(pygBrand::class,'brand_id','id');
    }

    public function image(){
        return $this->hasMany(PygGoodsImages::class,'goods_id')->bind(['pics_big','pics_sma']);
    }
}
